|
|
|
|
|
|
|
property's current value is denoted in the right side of the Properties window. Look for the Name property in the left column, which appears at the top of the list (because the Name property is so important, it appears before all the other properties, which are presented alphabetically. You can also sort the properties by Category by clicking the Categorized tab). Click the Name property, making it the current property (note that the property name is highlighted). Note the default valueText1of the Name property on the right side. At this point, you can simply type a new value for the Name property, or edit the existing value. Change the value of your TextBox control's Name property by typing a more descriptive namelet's use txtPrincipaland pressing Enter. Figure 2.10 shows the Properties window after making this change. |
|
|
|
|
|
|
|
|
A TextBox control's Text property represents the text that's entered in the boxthat is, what is displayed inside the box on the screen. As the user types in a text box, Visual Basic constantly modifies the text box's Text property to reflect the current contents of the box. By default, a new text box contains its own name; your new text box contains Text1 in its Text property (recall that Text1 was the control's name when it was created). You don't want anything in the Text property when the program starts; in other words, you want the box to start off empty. To accomplish this, locate the TextBox control's Text property in the Properties window. Select the current value (Text1), and press the Delete key. |
|
|
|
|
|
|
|
|
Figure 2.10
Use the Properties window to set
values for your controls' properties. |
|
|
|
|
|
|
|
|
Adding the Remaining Text Boxes |
|
|
|
|
|
|
|
|
Now that you've added one TextBox control to the form, it should be a simple matter to add the other text boxes that you need for your Loan Calculator program. Add three more text boxes to the form; name them txtIntRate, txtTerm, and txtPayment. Clear their Text properties as well. When you're done, your form should look similar to the one in Figure 2.11. |
|
|
|
|
|
|
|
|
If your form doesn't look exactly like the one in Figure 2.11, don't worry. One nice thing about a visual design environment is that you can change the appearance of objects quite easily. |
|
|
|
|
|